package com.trg.flex.remote
{
	public class FaultCodeHelper
	{
		public static const OUTCOME_FAULT:String = "fault";
		public static const OUTCOME_CONNECTION_FAULT:String = "connectionFault";
		public static const OUTCOME_AUTHENTICATION_FAULT:String = "authenticationFault";
		
		private static var faultToOutcomeMap:Object = {
			"Client.Error.MessageSend": "connectionFault",
			"Client.Error.DeliveryInDoubt": "connectionFault", //TODO: not sure about this one
			"Client.Authentication": "authenticationFault"
		}
		
		public static function faultCodeToOutcome(faultCode:String):String {
			var outcome:String = faultToOutcomeMap[faultCode];
			if (!outcome)
				outcome = OUTCOME_FAULT;
			return outcome;
		}

	}
}